<!--
 * @Descripttion: 
 * @version: 
 * @Author: by
 * @Date: 2021-10-21 16:27:37
 * @LastEditors: tc
 * @LastEditTime: 2022-03-09 10:14:48
-->
<template>
    <div class="middlebox">
        <div class="shuju-box">
            <div class="shuju-list" v-for="item,index in shujuData" :key="index">
                <div class="title-list">
                    <div class="title01">
                        {{item.shuzi}}/{{item.company}}
                    </div>
                    <div class="img">
                        <el-image
                            :src="item.img"
                            fit="fit"></el-image>
                    </div>
                    <div class="title02">
                        {{item.name}}
                    </div>
                </div>
                <video class="video-ya" preload="auto" autoplay="autoplay" ref="videos" muted loop src="@/assets/img/dashboard/shipinxiaoguo.webm"></video>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    props: {
        data: {
            default: () => {}
        }
    },
    data() {
        return {
            shujuData:[
                {
                    shuzi:'13.9亿',
                    name:'水库库容量',
                    company:'m³',
                    img:require('../../assets/img/dashboard/水库库容量.png')
                },
                {
                    shuzi:'11万',
                    name:'水库水域面积',
                    company:'m²',
                    img:require('../../assets/img/dashboard/水库水域面积.png')
                },
                {
                    shuzi:'12.5',
                    name:'预警最低水位',
                    company:'m³',
                    img:require('../../assets/img/dashboard/预警最低水位.png')
                },
                {
                    shuzi:'135',
                    name:'汛限水位',
                    company:'m³',
                    img:require('../../assets/img/dashboard/汛限水位.png')
                },
            ],
        }
    },
    watch: {
        data: {
            handler(val) {
                this.renderData()
            },
            deep:true
        }
    },
    mounted() {
        // this.renderData()
    },
    unmounted() {

    },
    methods: {
       renderData(){
           this.shujuData[0].shuzi = this.data.volume
           this.shujuData[1].shuzi = this.data.area
           this.shujuData[2].shuzi = this.data.minimumLevel
           this.shujuData[3].shuzi = this.data.limitLevel
       }
    }
}
</script>

<style lang="scss" scoped>
.middlebox {
    height: 100%;
    box-sizing: border-box;
    .shuju-box {
        display: flex;
        flex-flow: wrap;
        width: 100%;
        margin-top: 10px;
        height: 100%;
        align-content: space-around;
        justify-content: space-around;
        .shuju-list {
            position: relative;
            width: 49%;
            height: 49%;
             .title-list {
                position: absolute;
                left: 50%;
                top: 50%;
                width: 100%;
                height: 100%;
                display: flex;
                transform: translate(-50%, -50%);
                flex-flow: column;
                justify-content: center;
                >div {
                    display: flex;
                    justify-content: center;
                    letter-spacing:2px;
                }
                .title01 {
                    color:#FFBD38;
                    font-weight: bold;
                    font-size: 24px;
                }
                .title02 {
                    color:#fff;
                    font-size: 16px;
                }
                .img {
                    margin: 20px 0;
                }
            }
        }
    }
   
    .video-ya {
        position: absolute;
        left: 50%;
            top: 55%;
            width: 80%;
            transform:translate(-50%,-50%);
        mix-blend-mode:lighten;
        //     mix-blend-mode
        //  background-blend-mode
        }
}
</style>